【例子介绍】
原创开源播放器-包含歌曲列表,歌曲控件,歌手秀,歌曲下载,歌词下载,歌词秀 Code Write By TonyShu
【相关图片】全部原创
【源码结构】
procedure TMrRec.LoadLRC(s:string);
var
i,n:Integer;
str: WideString;
iRow:integer;
k:integer;
timestr:String;
content:WideString;
lastIndex:integer;
timeNum:integer;
FTextList:TStringList;
begin
FTextList:=TStringList.create;
FTextList.LoadFromFile(s);
lntList.Clear;
for i:=0 to FTextList.count -1 do
begin
str := FTextList[i];
lastIndex:=LastDelimiter(']',str);
timeNum:=lastIndex div 10;
content :=copy(str,lastIndex 1,length(str)-lastIndex) ;
if timeNum=0 then
else
for n:=0 to timeNum-1 do
begin
timestr:=copy(str,n*10 1,10) ;
If Copy(timestr,10,1)<>']' then Continue else If Copy(timestr,7,1)<>'.' then Continue Else
New(reclistTemp);
reclistTemp.TimeInt:=StrToFloat(Copy(timestr,2,2))*60 StrtoFloat(Copy(timestr,5,2)) StrtoFloat(Copy(timestr,8,2))/1000;
if content= '' then content := '...................';
reclistTemp.LrcStr:=(content);
reclistTemp.TimeStr:=FloatToStr(reclistTemp.TimeInt);
reclistTemp.TimeStrs:=timestr;
lntList.Add(reclistTemp);
lntList.Sort(@CompareNames);
end;
end;
FTextList.Free;
end;
评论